import React from 'react';

class TodoItem extends React.Component {
    constructor(props) {
        super(props);
        this.handleDeleteItem = this.handleDeleteItem.bind(this);
    }
    handleDeleteItem() {
        this.props.delete(this.props.content.key);
    }
    render() {
        const item = this.props.content.item;
        return (
            <div className='list-item'>
                <span className='text-value'>{item}</span>
                <span className='text-button' onClick={this.handleDeleteItem} >x</span>
            </div>
        );  
    }
}
export default TodoItem;